<%-- 
    Document   : detailtable
    Created on : Oct 29, 2011, 8:16:56 AM
    Author     : Venus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*,Beans.ThamSoHT, Models.ThamSoHT_Model, Models.Ban_Model"%>
<%
    int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
    String dsts = " 'numberofseat', 'areaname', 'notice', 'rightmsg', 'tablename', 'state', 'tableinfoo' "; // chuỗi chứa các mã tham số của trang này.
    ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.

    String areaname = mdsts[0].getTenTS();
    String notice = mdsts[1].getTenTS();
    String numberofseat = mdsts[2].getTenTS();
    String rightmsg = mdsts[3].getTenTS();
    String state = mdsts[4].getTenTS();
    String tableinfoo = mdsts[5].getTenTS();
    String tablename = mdsts[6].getTenTS();

    String msgright = notice + "/" + rightmsg;
    Vector v = (Vector) request.getAttribute("DSBan");
%>

    <div class="title">
        <%=tableinfoo %>
        
    </div>
    <div class="content">
        <form action="" name="detailtable">
        <table>
	<thead>
            <tr>
		<th style=" padding-bottom: 5px; width: 22%;"><%=areaname%></th>
		<th style="width: 14%; padding-bottom: 5px;"><%=tablename%></th>
                <th style="width: 15%; padding-bottom: 5px;"><%=numberofseat%></th>
                <th style="width: 20%; padding-bottom: 5px;"><%=state %></th>
                <th ></th>
            </tr>
	</thead>
        <tbody id="area">
            <%
                for(int i=0; i<v.size(); i++){
                    Beans.Ban b = (Beans.Ban) v.elementAt(i);
            %>
                    <tr>
                        <td class="STT"><%=Ban_Model.LayTenKV(b.getMaKV(), langid) %></td>
                        <td style=" padding-left: 10px;"><%=b.getTenBan() %></td>
                        <td style=" padding-left: 10px;"><div id="soghe"><%=b.getSoGhe() %></div></td>
                        <td>
                            <select name="<%=b.getMaBan() %>" class="<%=b.getMaKV() %>" lang="<%=msgright%>" onchange="UpdateTTBan(this.value, this.name, this.className, this.lang)">
                                <option value="<%=b.getMaTTBan() %>"><%=Ban_Model.LayTinhTrang(b.getMaBan(), langid) %></option>
                            <%
                                Ban_Model bm = new Ban_Model();
                                Vector vdstt = new Vector();
                                vdstt = bm.DanhSachTinhTrang(b.getMaTTBan(), langid);
                                for(int y=0; y< vdstt.size(); y++){
                                    Beans.TinhTrangBan ttb = (Beans.TinhTrangBan) vdstt.elementAt(y);
                            %>
                            <option value="<%=ttb.getMaTTBan() %>"><%=ttb.getTenTTBan() %></option>
                            <%  }
                            %>
                            </select>
                        </td>
                        <td>
                            <center>
                                <a href="#" name="<%=b.getMaBan() %>" id="<%=b.getSoGhe() %>"  onclick="Edit_soghe(this.name, this.id)"><img style=" margin-right: 12px; margin-left: 5px; width: 17px; margin-top: 2px;" alt="" src="../images/edit.png"></a>
                                <a href="#" name="<%=b.getMaBan() %>" lang="<%=msgright%>"  onclick="Save_soghe(this.name, this.lang)"><img style="width: 20px;" alt="" src="../images/save.png"></a>
                            </center>
                        </td>
                        </tr>
            <%  }
            %>
        </tbody>
        </table>
        </form>
    </div>

